/*
 * 
 * Copyright (C) 2010 Wilfried Elmenreich, Anita Sobe 
 * This file is part of VideoNetwork.
 * 
 * VideoNetwork is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. 
 */
package simulation;

import java.util.Random;

public class SimulatorConfig {

	private int nServers = 20;
	private double simStep = 1.0;
	private double fillServerRate = 0.1;
	private boolean logActivate = true;
	private Random rand = new Random(1234);
	private int contentTypes = 3;

	// per second, divide bitrate by 8
	// 10 Mbit
	private double defaultDatarate = 10000000.0 / 8.0; // in bytes
	private int consumersPerServerMin = 1;
	private int consumersPerServerMax = 20;

	public enum ScenarioType {
		SEARCH, REF, SIMPLEHORMONE, SIMPLEHORMONESEARCH, REFSEARCH, UNITSIZE, UNITSIZEREFSEARCH, DISSEMINATION, GOSSIP
	}

	public enum ReplicationType {
		OWNER, ADAPTOWNER, PATH, PATHRANDOM, HORMONE, POP, HRATING, PRATING
	}

	public enum GraphGenerator {
		RANDOM, SCALEFRE, MESH
	}

	public enum PresentationMode {
		SEQ, PAR, SIMP, MIXED;
	}

	private ScenarioType scenario = ScenarioType.SIMPLEHORMONE;
	private ReplicationType rep = ReplicationType.ADAPTOWNER;
	private GraphGenerator graphgen = GraphGenerator.RANDOM;
	private PresentationMode mode = PresentationMode.SEQ;

	double scaleFreeRank = 0.1;
	// scaleFree node gets more units
	double scaleFreeMult = 2;
	boolean cleanup = false;

	public SimulatorConfig() {
	}

	public SimulatorConfig(int servers) {
		this.nServers = servers;
	}

	public GraphGenerator getGraphgen() {
		return graphgen;
	}

	public void setGraphgen(GraphGenerator graphgen) {
		this.graphgen = graphgen;
	}

	public ReplicationType getRep() {
		return rep;
	}

	public void setRep(ReplicationType rep) {
		this.rep = rep;
	}

	public ScenarioType getScenario() {
		return scenario;
	}

	public void setScenario(ScenarioType scenario) {
		this.scenario = scenario;
	}

	public boolean isLogActivate() {
		return logActivate;
	}

	public void setLogActivate(boolean logActivate) {
		this.logActivate = logActivate;
	}

	public double getSimStep() {
		return simStep;
	}

	public void setSimStep(double simStep) {
		this.simStep = simStep;
	}

	public double getFillServerRate() {
		return fillServerRate;
	}

	public void setFillServerRate(double fillServerRate) {
		this.fillServerRate = fillServerRate;
	}

	public Random getRand() {
		return this.rand;
	}

	public void setRand(int seed) {
		this.rand = new Random(seed);
	}

	public int getnServers() {
		return nServers;
	}

	public void setnServers(int nServers) {
		this.nServers = nServers;
	}

	public int getContentTypes() {
		return contentTypes;
	}

	public void setContentTypes(int contentTypes) {
		this.contentTypes = contentTypes;
	}

	public double getDefaultDatarate() {
		return defaultDatarate;
	}

	public void setDefaultDatarate(double defaultDatarate) {
		this.defaultDatarate = defaultDatarate;
	}

	public int getConsumersPerServerMin() {
		return consumersPerServerMin;
	}

	public void setConsumersPerServerMin(int consumersPerServerMin) {
		this.consumersPerServerMin = consumersPerServerMin;
	}

	public int getConsumersPerServerMax() {
		return consumersPerServerMax;
	}

	public void setConsumersPerServerMax(int consumersPerServerMax) {
		this.consumersPerServerMax = consumersPerServerMax;
	}

	public PresentationMode getMode() {
		return mode;
	}

	public void setMode(PresentationMode mode) {
		this.mode = mode;
	}

	public boolean useCleanup() {
		return cleanup;
	}

	public void setCleanup(boolean useCleanup) {
		this.cleanup = useCleanup;

	}

}